/*
 * Copyright (C) 2008 xyzse
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/**
 * @file XInvertService.h
 * @version 0.0.0
 * @author zouxin ( zouxin2008@gmail.com )
 * @date 22/3/2008 0.0.0 created, by zouxin
 */
#ifndef _XYZINDEXSERVICE_H_
#define _XYZINDEXSERVICE_H_
#include <string>
#include <map>
#include <vector>

using namespace std;

typedef struct{
	unsigned int docid;
	unsigned int num;
}WordItem;


class XyzIndexService
{
	public:
		XyzIndexService();
		~XyzIndexService();
		
		void startService();
	private:
		map<string,vector<WordItem> > m_index;//invert index
		map<int,int> m_docindex;//doc index(key=docid,value=offset)
		void initFromFile();
};
#endif
